package com.power.sifa.net.service;

import com.plf.common.exception.BusinessException;
import com.power.sifa.net.model.Form_apply;

import java.io.IOException;
import java.util.Map;

public interface ApplyService {

    /**
     * 保存流程表单数据
     *
     * @param form_apply
     * @return 结果Map<code: number, msg: string>, code == 0 说明保存成功
     * @throws Exception
     */
    void saveApplyForm(String formid, Form_apply form_apply) throws Exception;

    /**
     * 自动产生申请号
     * 格式: YYYYMMDD00000
     *
     * @return
     */
    String generateApplyCode();

    /**
     * 提交申请
     * @param applyid
     */
    void submitApply(String applyid) throws BusinessException;

    /**
     * 读取表单数据
     *
     * @param formid
     * @param applyid 业务id
     * @return
     * @throws IOException
     * @throws BusinessException
     */
    Map<String, Object> loadApplyForm(String formid, String applyid) throws Exception;

    /**
     * 查询申请表字段, 表名+ '_' +字段名
     *
     * @param formid
     * @param applyid
     * @return
     */
    Map<String, Object> formLoadField(String formid, String applyid) throws Exception;
}
